ETH0 LWIP Echo Server Test

Create Vivado Project

Modify the parameters based on the previous Vivado project according to the schematic:

Schematic:

VeryCapture_20250619091229

Vivado parameter modification:

The pins for Ethernet0 are already fixed to the MIO pins on the PS side in the schematic: MIO16~MIO27.

Check MDIO, which is used for Ethernet communication (MDIO (Management Data Input/Output) is an interface protocol for managing Ethernet Physical Layer (PHY) chips). MDIO corresponds to MIO52 and MIO53.

VeryCapture_20250618175959

After completing the parameter configuration, click OK. The Block Design (BD) is as follows:

VeryCapture_20250619152621

Similarly, perform the subsequent operations to generate a new .xsa file:

VeryCapture_20250618121240

Create Vitis Application Project

Similarly, first update by clicking Update Hardware Specification. Select the .xsa file path. When the following dialog box appears, click OK, which indicates the update was successful.

VeryCapture_20250618121412

Modify the platform's BSP file: add the lwip library. Although there are two Board Support Packages, you must modify the one shown below. Modifying the other one will cause an error when creating the application project. Finally, click OK.

VeryCapture_20250619153845

After the modification, be sure to right-click the platform project and select Build Project. If you do not rebuild, creating the application project later will also result in an error.

VeryCapture_20250619153247

Create the application project. The only difference is selecting the lwIP Echo Server template:

image-20250623122948643

You can modify the IP address as needed (this should be the IP address of the development board).

For example, if the computer's IP is on the 192.168.3 subnet, you must modify the IP address and gateway in the code to be on the same 192.168.3 subnet to allow the server and client to ping each other:

image-20250623162548762

 

Compile and Debug

After the project compiles successfully, connect the development board's JTAG to the computer with a Type-C USB cable, and use another Type-C USB cable to connect the board's PS UART to the computer. Connect the board to the computer with an Ethernet cable. On the computer, open a serial terminal tool like MobaXterm and establish a connection with the board's PS UART. After powering on, you can observe through the serial port that the network has started, the IP address is 192.168.3.150, and the service port is 7.

image-20250813190816870

Ping this IP address from the computer. A successful ping indicates that the network connection is established:

image-20250813190855569

After connecting to the development board's server using a network debugging tool on your computer, any data you send to the board will be echoed back. (Set the port number to 7 and use the IP address obtained from the serial port output).

image-20250908145834618

image-20250908150024620